#include "process.h"

#define TARGET_SIZE 1024*1024
#define DSIZE 1024*10

void download(callback_t cb){
    int target=TARGET_SIZE;
    int total=0;

    while(total<target){
        usleep(STIME);
        total+=DSIZE;
        int rate=total*100/target;
        cb(rate);
    }
    printf("\n");
}

//下载的软件
int main(){
    download(process_v2);
        return 0;
        }
